{% extends 'home/home.html' %}
{% block index %}
{% load static %}
<div class="uk-section uk-margin-medium-top uk-container uk-margin-top-large" style="padding: 10px;">
    <div class="uk-margin-medium uk-grid" uk-grid="">
        <div class="uk-width-1-1 uk-width-1-1@s">
            <article class="uk-article" style="padding-bottom: 4em;">
                <h2 class="uk-article-title uk-text-center" style="color: #28a">
                    <strong>
                        {{ lesson_type }}课程
                    </strong>
                </h2>
                {% if "sc" in lesson_type %}
                <a href="https://create.codelab.club/projects/editor/" target="_blank"
                    class="uk-button uk-button-primary uk-width-1-1" style="background-color:#099">点我开始创作</a>
                {% endif %}
                {% if lessons %}
                {% for lv in lessons %}
                {% if lv %}
                <h3 class="uk-text-center" style="color:#099">
                    <span>
                        <strong>
                            {{lv.0.lv}}
                        </strong>
                    </span>
                    <hr class="uk-divider-icon uk-text-center">
                </h3>
                <table class="uk-table uk-table-striped uk-table-hover uk-table-small">
                    <thead>
                        <tr class="uk-text-lead " style="font-weight:bold;">
                            <th style="font-size: 1em;font-weight:bold; width: 200px;">序号</th>
                            <th style="font-size:  1em;font-weight:bold;word-break: keep-all;">课程名称</th>
                            <th class="uk-text-right" style="font-size: 1em;font-weight:bold; width: 200px;">
                                更新日期</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for lesson in lv %}
                        {% if lesson.show %}
                        <tr>
                            <td style="font-weight:bold;">{{ lesson.id }}</td>
                            <td>

                                <a href="{{ lesson.url }}?next={{ request.GET.next }}" target="_blank">
                                    <dt class="uk-text-normal uk-text-primary" style="font-size: 16px;font-weight: bold;">
                                        {{ lesson.name }}
                                    </dt>
                                </a>
                            </td>
                            <td class="uk-text-right" style="font-size: 16px;">{{ lesson.mtime }}</td>
                        </tr>
                        {% endif %}
                        {% endfor %}
                    </tbody>
                </table>
                {% endif %}
                {% endfor %}
                {% else %}
                <p>这里空无一人。</p>
                {% endif %}
            </article>

        </div>

    </div>

</div>
{% endblock %}